/**
 * 
 */
package jfood.ontology.meal;

import java.io.Serializable;
import java.util.ArrayList;

import jade.content.Concept;

/**
 * @author dawid
 * 
 */
public class Meal implements Concept, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5041257944898236789L;
	private String name_;
	private ArrayList<Ingredient> ingredients_;
	private Recipe recipe_;

	public Meal() {

	}
	public Meal(String name) {
		name_ = name;
		ingredients_ = new ArrayList<Ingredient> ();
		recipe_ = new Recipe();
	}

	public Meal(String name, ArrayList<Ingredient> ingredients, Recipe recipe) {
		name_ = name;
		ingredients_ = ingredients;
		recipe_ = recipe;
	}
	
		
	public String getName() {
		return name_;
	}

	public void setName(String name_) {
		this.name_ = name_;
	}
	
	public ArrayList<Ingredient> getIngredients() {
		return ingredients_;
	}

	public void setIngredients(ArrayList<Ingredient> ingredients) {
		ingredients_ = ingredients;
	}

	public Recipe getRecipe() {
		return recipe_;
	}

	public void setRecipe(Recipe recipe) {
		this.recipe_ = recipe;
	}
	
	public String toString() {
		String str = new String();

		if (name_ != null) {
			str += name_;
			str += "\n";
		}
		if(ingredients_ != null)
		{
			for (Ingredient i: ingredients_) {
				str += i.getName();
				str += "\n";
			}
		}
		str += "\n";
		if (recipe_ != null) {
			str += recipe_.getContent();
		}
		return str;
	}
}
